from View.guiroot import *
import tkinter as tk


#抄写数据页面
copyMenu = NewWorkingSpace(RF, "开始处理EXCEL", "抄写数据")
tk.Label(copyMenu.ws, text="").pack()

tk.Label(copyMenu.ws, text="请选择抄写的表格", font=20).pack(pady=5)
excel2CopyChooser = FileChooser(copyMenu.ws, multiple=False, filetypes=[("Excel文件", ".xlsx .xls"), ])
excel2CopyChooser.pack(pady=10)


copyPreviewWindow = SubWindow(copyMenu.ws, size="600x400", title="抄写结果预览")
copyPreviewButton = tk.Button(copyMenu.ws, text="预览抄写结果", width=30, command=copyPreviewWindow.open)
copySaveButton = tk.Button(copyMenu.ws, text="抄写表格数据并保存", width=30, command=lambda :print("抄写表格数据并保存"))

copyIndexBox = tk.Frame(copyMenu.ws)
tk.Label(copyIndexBox, text="请选择索引列: ").grid(row=0, column=0)
copyIndexChooser = DynamicDropMenu(copyIndexBox, width=25, buttonstate=False)
copyIndexChooser.grid(row=0, column=1)

toCopyIndexBox = tk.Frame(copyMenu.ws)
tk.Label(toCopyIndexBox, text="请选择抄写列: ").grid(row=0, column=0)
toCopyIndexChooser = DynamicDropMenu(toCopyIndexBox, width=25, buttonstate=False)
toCopyIndexChooser.grid(row=0, column=1)

tk.Label(copyMenu.ws, text='------------------------------------------------------------------').pack()

copyIndexBox.pack(pady=5, fill='x')
toCopyIndexBox.pack(pady=5, fill='x')
copyPreviewButton.pack(pady=5)
copySaveButton.pack(pady=5)

##对比结果预览
copyPreviewTable = DataFrameViewr(copyPreviewWindow.frame, name="抄写结果", df=excelCopyResult.df)
copyPreviewTable.pack()

